<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取变量的整数值</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.import-request-variables.html">import_request_variables</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.is-array.html">is_array</a></div>
 <div class="up"><a href="ref.var.html">Variable handling 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.intval" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">intval</h1>
    <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">intval</span> &mdash; <span class="dc-title">获取变量的整数值</span></p>

   </div>
   <div class="refsect1 unknown-unknown-unknown-unknown-unknown-unknown-seealsu" id="refsect1-function.intval-unknown-unknown-unknown-unknown-unknown-unknown-seealsu">
    <h3 class="title">描述</h3>
     <div class="methodsynopsis dc-description">
      <span class="type">int</span> <span class="methodname"><strong>intval</strong></span>
       ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$var</code></span>
      [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$base</code></span>
     ] )</div>

    <p class="simpara">
     通过使用特定的进制转换（默认是十进制），返回变量 <em><code class="parameter">var</code></em>
     的 <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> 数值。 
    </p>
    <p class="simpara">
     <em><code class="parameter">var</code></em> 可以是任何标量类型。<span class="function"><strong>intval()</strong></span>
     不能用于 <span class="type"><a href="language.types.array.html" class="type array">array</a></span> 或 <span class="type"><a href="language.types.object.html" class="type object">object</a></span>。
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      除非 <em><code class="parameter">var</code></em>
      参数是字符串，否则 <span class="function"><strong>intval()</strong></span>
      的 <em><code class="parameter">base</code></em>
      参数不会有效果。
     </p>
    </p></blockquote>
    <p class="simpara">
     参见 <span class="function"><a href="function.floatval.html" class="function">floatval()</a></span>、<span class="function"><a href="function.strval.html" class="function">strval()</a></span>、<span class="function"><a href="function.settype.html" class="function">settype()</a></span>
     和 <a href="language.types.type-juggling.html" class="link">类型戏法</a>。
    </p>
   </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.import-request-variables.html">import_request_variables</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.is-array.html">is_array</a></div>
 <div class="up"><a href="ref.var.html">Variable handling 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
